package com.hitqz.robot.api.business.vo;

import com.hitqz.robot.api.business.enums.WarningLevelEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author xupkun
 * @date 2024/8/6
 */
public class RobotWarningRecordVo {

    /**
     * 编号
     */
    @Schema(description="编号")
    private Long id;

    /**
     * 报警类型 0-机器人1-系统2-其他
     */
    @Schema(description="报警类型 0-机器人1-系统2-其他")
    private String type;


    @Schema(description="报警类型字符串")
    private String typeStr;

    /**
     * 服务ID
     */
    @Schema(description="服务ID")
    private String serviceId;

    /**
     * 报警标题
     */
    @Schema(description="报警标题")
    private String title;

    /**
     * 报警内容
     */
    @Schema(description="报警内容")
    private String content;

    /**
     * 报警时间
     */
    @Schema(description="报警时间")
    private LocalDateTime time;

    /**
     * 报警等级 0-告警 1-预警 2-提醒
     */
    @Schema(description="报警等级 0-告警 1-预警 2-提醒")
    private Integer level;

    @Schema(description="报警等级描述")
    private String levelStr;
    /**
     * 已读标志
     */
    @Schema(description="已读标志")
    private String flag;

    /**
     * 附件多个则用逗号隔开
     */
    @Schema(description="附件多个则用逗号隔开")
    private String files;

    /**
     * 备注
     */
    @Schema(description="备注")
    private String remark;


    @Schema(description="内操人员")
    private String auditor;

    @Schema(description="外操人员")
    private String operator;

    @Schema(description="原因")
    private String cause;

    @Schema(description="处理方式")
    private String approach;

    @Schema(description="检测结果id")
    private Long patrolResultId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeStr() {
        if (Objects.equals(type, "0"))  {
            return "机器人";
        }
        if (Objects.equals(type, "2")){
            return "检测";
        }
        return "系统";
    }

    public void setTypeStr(String typeStr) {
        this.typeStr = typeStr;
    }

    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getLevelStr() {
        return WarningLevelEnum.CMD_LEVEL_STATUS.get(level).getDesc();
    }

    public void setLevelStr(String levelStr) {
        this.levelStr = levelStr;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getFiles() {
        return files;
    }

    public void setFiles(String files) {
        this.files = files;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public String getAuditor() {
        return auditor;
    }

    public void setAuditor(String auditor) {
        this.auditor = auditor;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getCause() {
        return cause;
    }

    public void setCause(String cause) {
        this.cause = cause;
    }

    public String getApproach() {
        return approach;
    }

    public void setApproach(String approach) {
        this.approach = approach;
    }


    public Long getPatrolResultId() {
        return patrolResultId;
    }

    public void setPatrolResultId(Long patrolResultId) {
        this.patrolResultId = patrolResultId;
    }
}
